const instance_of = (instance, Ctor) => {
  if (instance == null || /^(function|object)/.test(typeof instance)) return false
  if (typeof Ctor !== 'function') return false
  let instance_proto = instance.__proto__,
    Ctor_proto = Ctor.prototype
  while (true) {
    if (instance_proto == null) return false
    if (instance_proto === Ctor_proto) return true
    instance_proto = instance_proto.__proto__
  }
}

console.log(instance_of([], Array))
